<?php
Yii::import('application.core.buscar_registro.Buscar_UserPc');
//include_once '/../buscar_registro/Buscar_UserPc.php';

class EliminarUserPc{

private $userPc;


//__________________INICIAR ELIMININACION________________________________
	public function __construct($id_busqueda,$tipo_de_dato){
		$busqueda=new Buscar_UserPc($id_busqueda, $tipo_de_dato);
		$this->userPc=$busqueda->get_userPc_encontrado();
	}

	public function get_userPc(){
		return $this->userPc;
	}

//__________________CONFIRMAR ELIMINAR________________________________
	public function confirmar(){
		if(isset($this->userPc)){
		    //mysqli_connect(host,username,password,dbname);
		    //$con=mysqli_connect("localhost","root","","base_datos"); 
		    $conexion=Yii::app()->db;//
		    // Check connection
		    if (mysqli_connect_errno()) {
		    	echo "Failed to connect to MySQL: " . mysqli_connect_error();
		    } else{
		    	$nro_registro=$this->userPc->get_nro_userPc();
				$consulta="Delete From user_pc WHERE nro_userPc=".$nro_registro." LIMIT 1";//
				$resultado=$conexion->createCommand($consulta)->execute();//
				
		    }
		}
	}
}
?>